package org.mg.frontend.security;

import org.springframework.security.crypto.codec.Base64;

import java.security.SecureRandom;

/**
 * @author MG
 * @since 06-04-2013
 */
public class SaltGenerator {
    private static final SecureRandom secureRandom = new SecureRandom();

    public static String getNewSalt() {
        byte[] saltBytes = new byte[AuthSaltSource.SALT_LENGTH];
        secureRandom.nextBytes(saltBytes);
        return new String(Base64.encode(saltBytes));
    }
}
